package 函数式接口;

import Java多线程技术.Run;

//函数式编程练习    方法形参是类库接口使用Lambda作为参数和返回值
public class Demo1 {

    public static void main(String[] args) {
        Runnable run = get();
        new Thread(run).start();
        //Lambda 作为形参
        set(()-> System.out.println("作为参数的Lmabda线程启动"));

    }

    private static void set(Runnable run) {
        new Thread(run).start();
    }

    private static Runnable get() {
        return () -> System.out.println("Lambda 线程启动。。。");
    }
}
